#! /bin/sh
/home/guillaume/.bashrc

#Goto here
here="/home/guillaume/Personal/bots"
cd $here

#Marvin feed address
feed="http://data.mohid.com/~guillaume/FileIt/marvinquotes_srtd.txt"

#temporary file
file="marvin_bot"

#Weather twitter bot
twitbot=marvin_bot:guigui

#Read the feed and randomize it
curl $feed | shuffle | tail -n 1 > $file.txt

#Read the message into a weather variable
read mess < $file.txt
echo $mess >> $file.log

#Timestamp the log file
echo -------------------------------------------->> $file.log
date >> $file.log

#Twit the weather variable away
curl --basic --user $twitbot --data status="$mess" http://twitter.com/statuses/update.xml >> $file.log
t 0 ]
then

    #Replace the message text
    cp $file.tmp $file.txt    

    #Timestamp the log file
    echo ------------------------------------------------------->> $file.log
    date >> $file.log

    #Read the forecast into a weather variable
    read mess < $file.txt
    #echo $mess

    #Twit the weather variable away
    curl --basic --user $twitbot --data status="$mess" http://twitter.com/statuses/update.xml >> $file.log

else

    #Print message
    echo ${file}.txt and ${file}.log are unchanged

fi
ro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </user>
</status>
-------------------------------------------------------
Sun Jun 24 12:24:11 WEST 2007
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <created_at>Sun Jun 24 11:24:12 +0000 2007</created_at>
  <id>118394632</id>
  <text>The ball numbers for EuroMillions drawn on 22 June 2007 at 21:00 are [34, 22, 17, 16, 11] and the star balls are [6, 5].</text>
  <user>
    <id>6895272</id>
    <name>euro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </user>
</status>
-------------------------------------------------------
Mon Jul  9 14:32:34 WEST 2007
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <created_at>Mon Jul 09 13:34:35 +0000 2007</created_at>
  <id>141366712</id>
  <text>The ball numbers for EuroMillions drawn on 06 July 2007 at 21:00 are [41, 39, 19, 5, 4] and the star balls are [9, 8].</text>
  <user>
    <id>6895272</id>
    <name>euro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </user>
</status>
-------------------------------------------------------
Sat Jul 14 02:14:01 WEST 2007
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <created_at>Sat Jul 14 01:16:51 +0000 2007</created_at>
  <id>149049712</id>
  <text>The ball numbers for EuroMillions drawn on 13 July 2007 at 21:00 are [48, 31, 15, 13, 9] and the star balls are [6, 3].</text>
  <user>
    <id>6895272</id>
    <name>euro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </use#! /bin/sh
/home/guillaume/.bashrc

#Goto here
here="/home/guillaume/Personal/bots"
cd $here

#Marvin feed address
feed="http://data.mohid.com/~guillaume/FileIt/marvinquotes_srtd.txt"

#temporary file
file="marvin_bot"

#Weather twitter bot
twitbot=marvin_bot:guigui

#Read the feed and randomize it
curl $feed | shuffle | tail -n 1 > $file.txt

#Read the message into a weather variable
read mess < $file.txt
echo $mess >> $file.log

#Timestamp the log file
echo -------------------------------------------->> $file.log
date >> $file.log

#Twit the weather variable away
curl --basic --user $twitbot --data status="$mess" http://twitter.com/statuses/update.xml >> $file.log
t 0 ]
then

    #Replace the message text
    cp $file.tmp $file.txt    

    #Timestamp the log file
    echo ------------------------------------------------------->> $file.log
    date >> $file.log

    #Read the forecast into a weather variable
    read mess < $file.txt
    #echo $mess

    #Twit the weather variable away
    curl --basic --user $twitbot --data status="$mess" http://twitter.com/statuses/update.xml >> $file.log

else

    #Print message
    echo ${file}.txt and ${file}.log are unchanged

fi
ro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </user>
</status>
-------------------------------------------------------
Sun Jun 24 12:24:11 WEST 2007
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <created_at>Sun Jun 24 11:24:12 +0000 2007</created_at>
  <id>118394632</id>
  <text>The ball numbers for EuroMillions drawn on 22 June 2007 at 21:00 are [34, 22, 17, 16, 11] and the star balls are [6, 5].</text>
  <user>
    <id>6895272</id>
    <name>euro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </user>
</status>
-------------------------------------------------------
Mon Jul  9 14:32:34 WEST 2007
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <created_at>Mon Jul 09 13:34:35 +0000 2007</created_at>
  <id>141366712</id>
  <text>The ball numbers for EuroMillions drawn on 06 July 2007 at 21:00 are [41, 39, 19, 5, 4] and the star balls are [9, 8].</text>
  <user>
    <id>6895272</id>
    <name>euro millions</name>
    <screen_name>euromillions</screen_name>
    <location>europe</location>
    <description>Find every friday night the results for the euromillions lottery!</description>
    <profile_image_url>http://assets2.twitter.com/system/user/profile_image/6895272/normal/euromillions.jpg?1182184985</profile_image_url>
    <url>http://www.euromillions.be/index.aspx</url>
    <protected>false</protected>
  </user>
</status>
-------------------------------------------------------
Sat Jul 14 02:14:01 WEST 2007
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <created_at>Sat Jul 14 01:16:51 +0000 2007</created_at>
  <id>149049712</id>
  <text>The ball numbers for EuroMillions drawn on 13 July 2007 at 21:00 ar